package com.chain.BrotherExchange.utils;

import android.graphics.Rect;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.View;

import com.chain.BrotherExchange.R;

public class FirstItemMarginDecoration extends RecyclerView.ItemDecoration {

    @Override
    public void getItemOffsets(
            @NonNull Rect outRect, @NonNull View view, @NonNull RecyclerView parent,
            @NonNull RecyclerView.State state) {
        if (parent.getChildAdapterPosition(view) == 0) {
            outRect.top = parent.getContext().getResources().getDimensionPixelSize(R.dimen.small_space);
        }
    }
}
